using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._MapSeries
{
    /// <summary>
    /// <para>Grid Index Features</para>
    /// <para>Creates a grid of rectangular polygon features that can be used as an index to specify pages in a spatial map series. A grid can be created that includes only polygon features that intersect another feature layer.</para>
    /// <para>创建矩形面要素的格网，该格网可用作索引以指定空间地图系列中的页面。可以创建仅包含与另一个要素图层相交的面要素的格网。</para>
    /// </summary>    
    [DisplayName("Grid Index Features")]
    public class GridIndexFeatures : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GridIndexFeatures()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para><xdoc>
        ///   <para>The resulting feature class of polygon index features.</para>
        ///   <para>The coordinate system of the output feature class is determined in the following order:</para>
        ///   <bulletList>
        ///     <bullet_item>If a coordinate system is specified by the Output Coordinate System environment, the output feature class will use this coordinate system.</bullet_item><para/>
        ///     <bullet_item>If a coordinate system is not specified by the Output Coordinate System environment, the output feature class will use the coordinate system of the active map (ArcGIS Pro is open).</bullet_item><para/>
        ///     <bullet_item>If a coordinate system is not specified by the Output Coordinate System environment, and there is no active map (ArcGIS Pro is not open), the output feature class will use the coordinate system of the first input feature.</bullet_item><para/>
        ///     <bullet_item>If a coordinate system is not specified by the Output Coordinate System environment, there is no active map (ArcGIS Pro is not open), and there are no specified input features, the coordinate system of the output feature class will be unknown.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>面索引要素的结果要素类。</para>
        ///   <para>输出要素类的坐标系按以下顺序确定：</para>
        ///   <bulletList>
        ///     <bullet_item>如果输出坐标系环境指定了坐标系，则输出要素类将使用此坐标系。</bullet_item><para/>
        ///     <bullet_item>如果输出坐标系环境未指定坐标系，则输出要素类将使用活动地图的坐标系（ArcGIS Pro 已打开）。</bullet_item><para/>
        ///     <bullet_item>如果输出坐标系环境未指定坐标系，并且没有活动地图（ArcGIS Pro 未打开），则输出要素类将使用第一个输入要素的坐标系。</bullet_item><para/>
        ///     <bullet_item>如果输出坐标系环境未指定坐标系，则没有活动地图（ArcGIS Pro 未打开），并且没有指定的输入要素，则输出要素类的坐标系将未知。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public GridIndexFeatures(object _out_feature_class)
        {
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Grid Index Features";

        public override string CallName => "cartography.GridIndexFeatures";

        public override List<string> AcceptEnvironments => ["outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_out_feature_class, _in_features, _intersect_feature.GetGPValue(), _use_page_unit.GetGPValue(), _scale, _polygon_width, _polygon_height, _origin_coord, _number_rows, _number_columns, _starting_page_number, _label_from_origin.GetGPValue()];

        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para><xdoc>
        ///   <para>The resulting feature class of polygon index features.</para>
        ///   <para>The coordinate system of the output feature class is determined in the following order:</para>
        ///   <bulletList>
        ///     <bullet_item>If a coordinate system is specified by the Output Coordinate System environment, the output feature class will use this coordinate system.</bullet_item><para/>
        ///     <bullet_item>If a coordinate system is not specified by the Output Coordinate System environment, the output feature class will use the coordinate system of the active map (ArcGIS Pro is open).</bullet_item><para/>
        ///     <bullet_item>If a coordinate system is not specified by the Output Coordinate System environment, and there is no active map (ArcGIS Pro is not open), the output feature class will use the coordinate system of the first input feature.</bullet_item><para/>
        ///     <bullet_item>If a coordinate system is not specified by the Output Coordinate System environment, there is no active map (ArcGIS Pro is not open), and there are no specified input features, the coordinate system of the output feature class will be unknown.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>面索引要素的结果要素类。</para>
        ///   <para>输出要素类的坐标系按以下顺序确定：</para>
        ///   <bulletList>
        ///     <bullet_item>如果输出坐标系环境指定了坐标系，则输出要素类将使用此坐标系。</bullet_item><para/>
        ///     <bullet_item>如果输出坐标系环境未指定坐标系，则输出要素类将使用活动地图的坐标系（ArcGIS Pro 已打开）。</bullet_item><para/>
        ///     <bullet_item>如果输出坐标系环境未指定坐标系，并且没有活动地图（ArcGIS Pro 未打开），则输出要素类将使用第一个输入要素的坐标系。</bullet_item><para/>
        ///     <bullet_item>如果输出坐标系环境未指定坐标系，则没有活动地图（ArcGIS Pro 未打开），并且没有指定的输入要素，则输出要素类的坐标系将未知。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input features to be used to define the extent of the polygon grid that will be created.</para>
        /// <para>用于定义将要创建的面格网范围的输入要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_features { get; set; } = null;


        /// <summary>
        /// <para>Generate Polygon Grid that intersects input feature layers or datasets</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output grid feature class is limited to areas that intersect input feature layers or datasets. The intersection of input features will be used to create index features.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Limits the output grid feature class to areas that intersect input feature layers or datasets. When input features are specified, this is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—An output grid feature class is created using specified coordinates, rows, and columns.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出格网要素类是否仅限于与输入要素图层或数据集相交的区域。输入要素的交集将用于创建索引要素。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将输出格网要素类限制为与输入要素图层或数据集相交的区域。指定输入要素时，这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 使用指定的坐标、行和列创建输出格网要素类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Generate Polygon Grid that intersects input feature layers or datasets")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _intersect_feature_value _intersect_feature { get; set; } = _intersect_feature_value._false;

        public enum _intersect_feature_value
        {
            /// <summary>
            /// <para>INTERSECTFEATURE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INTERSECTFEATURE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_INTERSECTFEATURE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_INTERSECTFEATURE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Use Page Unit and Scale</para>
        /// <para><xdoc>
        ///   <para>Specifies whether index polygon size input is in page units.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Index polygon height and width are calculated in page units.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Index polygon height and width are calculated in map units. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定索引多边形大小输入是否以页面单位表示。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 索引面的高度和宽度以页面单位计算。</bullet_item><para/>
        ///     <bullet_item>未选中 - 索引面的高度和宽度以地图单位计算。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use Page Unit and Scale")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _use_page_unit_value _use_page_unit { get; set; } = _use_page_unit_value._false;

        public enum _use_page_unit_value
        {
            /// <summary>
            /// <para>USEPAGEUNIT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USEPAGEUNIT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_USEPAGEUNIT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_USEPAGEUNIT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Map Scale</para>
        /// <para>The map scale. The scale must be specified if the index polygon height and width are to be calculated in page units. If the tool is used outside an active ArcGIS Pro session, the default scale value is 1.</para>
        /// <para>地图比例。如果要以页为单位计算索引面的高度和宽度，则必须指定比例。如果在活动 ArcGIS Pro 会话之外使用该工具，则默认比例值为 1。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Map Scale")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _scale { get; set; } = null;


        /// <summary>
        /// <para>Polygon Width</para>
        /// <para>The width of the index polygon specified in either map or page units. If page units are used, the default value is 1 inch. If map units are used, the default value is 1 degree.</para>
        /// <para>以地图或页面单位指定的索引面的宽度。如果使用页面单位，则默认值为 1 英寸。如果使用地图单位，则默认值为 1 度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polygon Width")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _polygon_width { get; set; } = "1 DecimalDegrees";


        /// <summary>
        /// <para>Polygon Height</para>
        /// <para>The height of the index polygon specified in either map or page units. If page units are used, the default value is 1 inch. If map units are used, the default value is 1 degree.</para>
        /// <para>以地图或页面单位指定的索引面的高度。如果使用页面单位，则默认值为 1 英寸。如果使用地图单位，则默认值为 1 度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polygon Height")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _polygon_height { get; set; } = "1 DecimalDegrees";


        /// <summary>
        /// <para>Polygon Grid Origin Coordinate</para>
        /// <para>The coordinate value for the lower left origin of the output grid feature class. If input features are specified, the default value is determined by the extent of the union of extents for these features. If there are no input features specified, the default coordinates are 0 and 0.</para>
        /// <para>输出格网要素类左下端的坐标值。如果指定了输入要素，则默认值由这些要素的范围并集范围确定。如果未指定输入要素，则默认坐标为 0 和 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polygon Grid Origin Coordinate")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _origin_coord { get; set; } = null;


        /// <summary>
        /// <para>Number of Rows</para>
        /// <para>The number of rows to create in the y direction from the point of origin. The default is 10.</para>
        /// <para>从原点沿 y 方向创建的行数。默认值为 10。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Rows")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _number_rows { get; set; } = 10;


        /// <summary>
        /// <para>Number of Columns</para>
        /// <para>The number of columns to create in the x direction from the point of origin. The default is 10.</para>
        /// <para>从原点沿 x 方向创建的列数。默认值为 10。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Columns")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _number_columns { get; set; } = 10;


        /// <summary>
        /// <para>Starting Page Number</para>
        /// <para>Each grid index feature is assigned a sequential page number starting with a specified starting page number. The default is 1.</para>
        /// <para>为每个格网索引要素分配一个从指定的起始页码开始的连续页码。默认值为 1。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Starting Page Number")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _starting_page_number { get; set; } = 1;


        /// <summary>
        /// <para>Start labeling from the Origin</para>
        /// <para><xdoc>
        ///   <para>Specifies where page numbers (labels) begin.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Page numbers (labels) begin with the polygon feature in the lower left corner of the output grid.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Page numbers (labels) begin with the polygon feature in the upper left corner of the output grid. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定页码（标签）的起始位置。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 页码（标注）以输出格网左下角的面要素开头。</bullet_item><para/>
        ///     <bullet_item>未选中 - 页码（标注）以输出格网左上角的面要素开头。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Start labeling from the Origin")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _label_from_origin_value _label_from_origin { get; set; } = _label_from_origin_value._false;

        public enum _label_from_origin_value
        {
            /// <summary>
            /// <para>LABELFROMORIGIN</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("LABELFROMORIGIN")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_LABELFROMORIGIN</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_LABELFROMORIGIN")]
            [GPEnumValue("false")]
            _false,

        }

        public GridIndexFeatures SetEnv(object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}